import { getStorage } from "./storage";
import config from "./config";

export const reportEvent = (eventId, params = {}) => {
  const userInfo = getStorage("userInfo");
  wx.reportEvent(eventId, {
    ...params,
    user_id: userInfo ? JSON.stringify({id: userInfo.id, mobile: userInfo?.mobile}) : '',
    env: config.ENV
  })
}